﻿using MahApps.Metro.Controls;
using MetroApp.Web.Views;
using Prism.Mvvm;
using System;
using System.Collections.ObjectModel;

namespace MetroApp.Web.ViewModels
{
    public class HamburgerViewModel : BindableBase
    {

        private ObservableCollection<MenuItem> _menus;

        public ObservableCollection<MenuItem> Menus
        {
            get { return _menus; }
            set { 
                _menus = value; 
                RaisePropertyChanged();
            }
        }

        public HamburgerViewModel()
        {
            Menus = new ObservableCollection<MenuItem>
            {
                // 一级菜单
                new MenuItem
                {
                    Label = "主页",
                    Icon = new FontIcon { Glyph = "\uE80F" },        // 图标
                    NavigationType = typeof(mainpage),               // 要导航到的 Page
                    NavigationDestination = new Uri("Views/mainpage.xaml", UriKind.Relative)
                },
                new MenuItem
                {
                    Label = "用户",
                    Icon = new FontIcon { Glyph = "\uE77B" },
                    NavigationType = typeof(UserManager),
                    NavigationDestination = new Uri("Views/UserManager.xaml", UriKind.Relative)
                },
                new MenuItem
                {
                    Label = "设置",
                    Icon = new FontIcon { Glyph = "\uE713" },
                    NavigationType = typeof(Settings),
                    NavigationDestination = new Uri("Views/Settings.xaml", UriKind.Relative)
                }
            };

        }

        //public class Menu
        //{
        //    public string Label { get; set; } = "";
        //    public object Icon { get; set; }// 可以是 string、Path、FontIcon 等

        //    public Type Target { get; set; }   // 点击后要导航到的 Page 类型
        //}
    }
}
